//
//  NewDuoBaoVC.m
//  夺宝吧
//
//  Created by xiaocai on 15/12/18.
//  Copyright © 2015年 FangYuan. All rights reserved.
//

#import "NewDuoBaoVC.h"
#import "SettingCell.h"
#import "SettingModel.h"
#import "WYPublic.h"
#import "DuoBaoHisVC.h"
#import "RewardsVC.h"
#import "ShowOrderVC.h"
#import "AddressVC.h"
#import "MingXiVC.h"
#import "WYPublicWeb.h"
#import "UserInfo.h"
#import "UIButton+WebCache.h"
#import "MoreVC.h"
#import "ChongZhiController.h"
#import "SettingVC.h"
#import "WYRequest.h"
//#import "RedPacketHistoryVC.h"



static NSString *REDHISTORYCELLID = @"SettingCell";
static NSString *REDHISTORYCELLID2 = @"SettingCell2";

@interface NewDuoBaoVC ()<UITableViewDataSource , UITableViewDelegate , UIAlertViewDelegate>

@property (nonatomic , assign) NSInteger indexEdge;

@end

@implementation NewDuoBaoVC

+ (instancetype)shareMyDuoBaoVC{
    static NewDuoBaoVC *staticDuoBaoVC = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        staticDuoBaoVC = [[NewDuoBaoVC alloc]initWithNibName:@"NewDuoBaoVC" bundle:nil];
    });
    
    return staticDuoBaoVC;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSString *show_shopping = [[NSUserDefaults standardUserDefaults] valueForKey:@"show_shopping"];
    self.indexEdge = 0;
    if (show_shopping.integerValue == 1) {
        self.indexEdge = 0;
    }else{
        self.indexEdge = 1;
    }
    
    [self loadCustomNaviBar];
    
    [self loadtableView];
    
    [self setUpData];
    
    [self initHeaderView];
}

- (void)viewWillAppear:(BOOL)animated{
    [super  viewWillAppear:animated];
    
    [self updateMyInfo];
    
    [self requestForUserInfo];
    
}

- (void)initHeaderView{
    
    self.userImageBtn.layer.cornerRadius =  65 / 2.0;
    self.userImageBtn.layer.borderColor = [UIColor whiteColor].CGColor;
    self.userImageBtn.layer.borderWidth = 1.0f;
    self.userImageBtn.clipsToBounds  = YES;
    
    self.rechargeBtn.layer.cornerRadius =  2.0f;
    self.rechargeBtn.layer.borderColor = [UIColor whiteColor].CGColor;
    self.rechargeBtn.layer.borderWidth = 1.0f;
}

//请求用户信息
- (void)requestForUserInfo
{
    if ([UserInfo getUserID] != nil && [UserInfo getUserToken]!=nil && [UserInfo getRefreshToken]!= nil) {
        //唯一标示devicetoken
        NSString *device_token = [[NSUserDefaults standardUserDefaults] objectForKey:@"DEVICETOKEN"];
        
        //update by weienjie 20150917
        NSMutableDictionary *params =[NSMutableDictionary dictionaryWithDictionary:@{@"refresh_cache":@"1",@"uid":[UserInfo getUserID],@"token":[UserInfo getUserToken],@"refresh_token":[UserInfo getRefreshToken]}];
        if (device_token)
        {
            [params setObject:device_token forKey:@"device_token"];
        }
        //update end
        
        
        [WYRequest startPostForDicWithUrlStR:[NSString stringWithFormat:@"%@%@",DBB_IP,GET_USERINFO_URL] Parameters:params successBlock:^(NSDictionary *dic) {
            [UserInfo updateUserInfoWithDic:dic[@"data"]];
            //是否上架标志show_pay
            if ([dic[@"data"][@"show_pay"] class]!= [NSNull class]) {
                NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
                NSNumber *flag = dic[@"data"][@"show_pay"];
                [user setObject:flag forKey:@"user_show_pay"];
            }
            [self showBtn];
            [self updateMyInfo];
            //保存分享信息
            [UserInfo setShareTitle:dic[@"data"][@"share_title"] Content:dic[@"data"][@"share_content"] ShareURL:dic[@"data"][@"share_link"]];
            //保存一键加群key
            [UserInfo keyForAddQQ:[WYPublic getUsefullStr:dic[@"data"][@"one_key_add_qq_group"]] Num:dic[@"data"][@"one_key_add_qq_group_num"]];
        } failedBlock:^{
            
        } needLog:NO];
    }
}
-(void)showBtn
{
    //上架前处理
    //    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    //    NSNumber *flag = [user objectForKey:@"user_show_pay"];
    //    if ([flag intValue] == 0) {
    //        ChongZhiBtn.hidden = YES;
    //    }else{
    //        ChongZhiBtn.hidden = NO;
    //    }
    NSString *show_shopping = [[NSUserDefaults standardUserDefaults] valueForKey:@"show_shopping"];
    [self.rechargeBtn setHidden:YES];
    if (show_shopping.integerValue == 1) {
        [self.rechargeBtn setHidden:NO];
    }
    
    
}
//刷新个人信息
- (void)updateMyInfo
{
    
    UserInfo *user = [[UserInfo alloc]init];
    self.userNameLabel.text = user.user_name;
    if (user.user_money != nil) {
        self.duobiLabel.text = [NSString stringWithFormat:@"夺币:%@",user.user_money];
    }else{
        self.duobiLabel.text = @"夺币:0";
    }
    if (user.user_jifen != nil) {
        self.jifenLabel.text = [NSString stringWithFormat:@"积分:%@",user.user_jifen];
    }else{
        self.jifenLabel.text = @"积分:0";
    }
    [[self.loginBtn layer] setCornerRadius:4.0];
    [[self.loginBtn layer] setBorderColor:[UIColor whiteColor].CGColor];
    [[self.loginBtn layer] setBorderWidth:1.0];
    
    if(![UserInfo isUserLogin]){
        [self.userImageBtn setImage:[UIImage imageNamed:@"iphone_5.png"] forState:UIControlStateNormal];;
        [self.loginBtn setHidden:NO];
        [self.duobiLabel setHidden:YES];
        [self.jifenLabel setHidden:YES];
        [self.userNameLabel setHidden:YES];
        
    }else
    {
        [self.userImageBtn sd_setImageWithURL:[NSURL URLWithString:user.user_header_img_path] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"iphone_5"] completed:nil];
//        [headerImg sd_setImageWithURL:[NSURL URLWithString:user.user_header_img_path] placeholderImage:[UIImage imageNamed:@"moren_header"]];
        [self.loginBtn setHidden:YES];
        [self.duobiLabel setHidden:NO];
        [self.jifenLabel setHidden:NO];
        [self.userNameLabel setHidden:NO];
    }
    
    NSString *show_shopping = [[NSUserDefaults standardUserDefaults] valueForKey:@"show_shopping"];
    if (show_shopping.integerValue == 1 && [UserInfo isUserLogin]) {
        [self.rechargeBtn setHidden:NO];
    }
    else
    {
        [self.rechargeBtn setHidden:YES];
    }
    //请求系统消息
    //    [self requestForNews];

}


//设置数据
- (void)setUpData{
    
    self.data = [NSMutableArray array];

    SettingModel *model1  = [[SettingModel alloc]init];
    model1.cusTitle = @"夺宝记录";
    model1.imageStr = @"icon_dbjl";
    model1.index = 0;
    
    SettingModel *model2  = [[SettingModel alloc]init];
    model2.cusTitle = @"中奖信息";
    model2.imageStr = @"icon_zj";
    model1.index = 1;
    
    SettingModel *model3  = [[SettingModel alloc]init];
    model3.cusTitle = @"晒单记录";
    model3.imageStr = @"icon_sd";
    model1.index = 2;
    
    SettingModel *model4  = [[SettingModel alloc]init];
    model4.cusTitle = @"夺宝红包";
    model4.imageStr = @"icon_hb";
    model1.index = 3;

    
    SettingModel *model5  = [[SettingModel alloc]init];
    model5.cusTitle = @"收获信息";
    model5.imageStr = @"icon_sh";
    model1.index = 4;

    
    SettingModel *model6  = [[SettingModel alloc]init];
    model6.cusTitle = @"账户明细";
    model6.imageStr = @"icon_zh";
    model1.index = 5;

    
    SettingModel *model7  = [[SettingModel alloc]init];
    model7.cusTitle = @"联系客服";
    model7.imageStr = @"icon_kefu";
    model1.index = 6;

    
    
    
//    NSString *show_shopping = [[NSUserDefaults standardUserDefaults] valueForKey:@"show_shopping"];

//    if (show_shopping.integerValue == 1) {
//        models = @[model1,model2,model3,model4,model5,model6,model7];
//    }else{
//        models = @[model1,model2,model3,model5,model6,model7];
//    }
    NSArray *models = nil;
    models = @[model1,model2,model3,model5,model6,model7];
//    for (NSInteger index = 0 ; index < models.count ; index++){
//        SettingModel *model = models[index];
//        model.index =  index;
//    }

    [self.data addObjectsFromArray:models];
    

}

#pragma mark -- 设置navBar
- (void)loadCustomNaviBar
{
    UIView *naviBar = [[UIView alloc]initWithFrame:CGRectMake(0, 0, WYMWITH, 20+44)];
    naviBar.backgroundColor = QBB_RED_COLOR;
    naviBar.alpha = 1.0;
    //返回按钮
//    PublicBackBtn *backBtn = [[PublicBackBtn alloc]initWithVC:self andBackType:pop Img:[UIImage imageNamed:@"icon_login_more.png"]];
//    [naviBar addSubview:backBtn];
    //设置按钮
    UIButton *settingBtn = [UIButton buttonWithType:0];
    settingBtn.frame = CGRectMake(WYMWITH - 45, 20, 40, 40);
    [settingBtn setImage:[UIImage imageNamed:@"icon_login_more"] forState:UIControlStateNormal];
    [settingBtn setImage:[UIImage imageNamed:@"icon_login_more_pressed"] forState:UIControlStateHighlighted];
    [settingBtn addTarget:self action:@selector(settingBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [naviBar addSubview:settingBtn];
    //标题
    UILabel *titleLab = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 25)];
    titleLab.center = CGPointMake(WYMWITH/2, 42);
    titleLab.text = @"我的夺宝";
    titleLab.font = [UIFont systemFontOfSize:TITLE_SIZE];
    titleLab.textAlignment = NSTextAlignmentCenter;
    titleLab.textColor = [UIColor whiteColor];
    //分割线
//    UILabel *fenge = [[UILabel alloc]initWithFrame:CGRectMake(0, 63.5, WYMWITH, 0.5)];
//    fenge.backgroundColor = [UIColor lightGrayColor];
//    [naviBar addSubview:fenge];
    [naviBar addSubview:titleLab];
    [self.view addSubview:naviBar];
}


#pragma mark -- 加载tableView
- (void)loadtableView
{
    //    self.automaticallyAdjustsScrollViewInsets = NO;
    CGFloat width = 44+20 + 78;
    self.cusTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, width, WYMWITH, WYMHEIGHT-width-49) style:UITableViewStylePlain];
    self.cusTableView.dataSource =self;
    self.cusTableView.delegate = self;
    //    self.cusTableView.rowHeight = 65.0f;
    //    self.cusTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    //    self.cusTableView.sectionFooterHeight = 1.0f;
    //    self.cusTableView.backgroundColor = [UIColor whiteColor];
    self.cusTableView.tableFooterView = [[UIView alloc]init];
    
    //注册cell
//    [self.cusTableView registerNib:[UINib nibWithNibName:REDHISTORYCELLID bundle:nil] forCellReuseIdentifier:REDHISTORYCELLID];
    [self.cusTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:REDHISTORYCELLID];
    [self.cusTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:REDHISTORYCELLID2];

    [self.view addSubview:self.cusTableView];
    
    
}

#pragma mark -- talbeView的数据源

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
   
    return 44.0f;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return  self.data.count + 1;
}

#pragma  mark -- tableView事件
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
//    SettingCell *cell = [tableView dequeueReusableCellWithIdentifier:REDHISTORYCELLID forIndexPath:indexPath];
//    
//    SettingModel *model = self.data[indexPath.row];
//    
//    [cell configureWithModel:model];
    
    
    if (indexPath.row < self.data.count){
         UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:REDHISTORYCELLID forIndexPath:indexPath];
        SettingModel *model = [self.data objectAtIndex:indexPath.row];
        cell.imageView.image = [UIImage imageNamed:model.imageStr];
        cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
        //    cell.imageView.frame =  CGRectMake(0, 0, 20, 20);
        //    cell.contentScaleFactor = 0.8;
        cell.textLabel.text = model.cusTitle;
        cell.textLabel.font = [UIFont systemFontOfSize:16];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        

        return cell;

    }
   

    if (indexPath.row == self.data.count){
        UITableViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:REDHISTORYCELLID2 forIndexPath:indexPath];
        cell.textLabel.text = @"所有奖品抽奖活动与苹果公司(Apple Inc.)无关";
        cell.textLabel.font = (WYMWITH > 350)? [UIFont systemFontOfSize:16]:[UIFont systemFontOfSize:14];
        cell.textLabel.textAlignment = NSTextAlignmentCenter;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    return nil;
}

//cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    
    
    switch (indexPath.row) {
        case 0:/***************夺宝记录************/
        {
            if( [WYPublic ifUserHaveLogin]){
                DuoBaoHisVC *hisVC = [[DuoBaoHisVC alloc]init];
                hisVC.isMyRecordFlag = YES;
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:hisVC animated:YES];
            }
            
        }
            break;
        case 1:/***************中奖记录************/
        {
            if( [WYPublic ifUserHaveLogin]){
                RewardsVC *reward = [[RewardsVC alloc]init];
                reward.isMyRecordFlag = YES;
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:reward animated:YES];
                
            }
        }
            break;
        case 2:/***************晒单记录************/
        {
            if( [WYPublic ifUserHaveLogin]){
                ShowOrderVC *showvc = [[ShowOrderVC alloc]init];
                showvc.userId = [UserInfo getUserID];
                showvc.isMyRecordFlag = YES;
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:showvc animated:YES];
                
            }
            
        }
            break;
//        case 3:/***************夺宝红包************/
//        {
//            if( [WYPublic ifUserHaveLogin]){
////                AddressVC *addressVC = [[AddressVC alloc]init];
//                RedPacketHistoryVC *redPacketVC = [[RedPacketHistoryVC alloc]init];
//                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:redPacketVC animated:YES];
//                
//            }
//            break;
//        }
        case 3:/***************收货地址************/
        {
            if( [WYPublic ifUserHaveLogin]){
                AddressVC *addressVC = [[AddressVC alloc]init];
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:addressVC animated:YES];
                
            }
        }
            break;
        case 4:/***************账户明细************/
        {
            if( [WYPublic ifUserHaveLogin]){
                MingXiVC *mingxiVC = [[MingXiVC alloc]init];
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:mingxiVC animated:YES];
                
            }
            
        }
            break;
        case 5:/***************联系客服************/
        {
            NSString *show_customService = [[NSUserDefaults standardUserDefaults] valueForKey:@"show_shopping"];
            if (show_customService.integerValue == 1 ) {
                
                WYPublicWeb *web = [[WYPublicWeb alloc]init];
                web.mtitle = @"联系客服";
                NSString *newIp = [DBB_IP stringByReplacingOccurrencesOfString:@"?/" withString:@""];
                web.urlStr = [NSString stringWithFormat:@"%@%@",newIp,FEEDBACK_URL];
                [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:web animated:YES];
            
            }
            else
            {
             
                UIAlertView *alertView =[[UIAlertView alloc]initWithTitle:@"官方客服电话" message:@"0755-86200743" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
                
                [alertView show];
                //                    telprompt
                
            }
            
            
        }
            break;
        default:
            break;
    }
    
}

//打电话的确认对话框代理
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex == 1){
        [[UIApplication sharedApplication]openURL:[NSURL URLWithString: @"tel://075586200743" ]];
    }
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)userImageClick:(UIButton *)sender {
    
    if([WYPublic ifUserHaveLogin]){
        SettingVC *setVC = [[SettingVC alloc]init];
        [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:setVC animated:YES];
    }
}

- (IBAction)loginBtnClick:(UIButton *)sender {
    [WYPublic ifUserHaveLogin];
}

- (IBAction)rechargeBtnClick:(UIButton *)sender {
    
    [self goToPay];
}


//设置按钮的响应事件
- (void)settingBtnClick:(UIButton *)sender{
    MoreVC *morevc = [[MoreVC alloc]init];
    [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:morevc animated:YES];
}


//跳往充值页面
- (void)goToPay
{
    [WYPublic addZheZhaoToWindowWithTitle:nil];
    NSDictionary *params = @{@"uid":[UserInfo getUserID],@"token":[UserInfo getUserToken],@"refresh_token":[UserInfo getRefreshToken]};
    [WYRequest startPostForDicWithUrlStR:[NSString stringWithFormat:@"%@%@",DBB_IP,PEIZHI_URL] Parameters:params successBlock:^(NSDictionary *dic) {
        NSNumber *ret = dic[@"ret"];
        if (ret.intValue == 0) {
            //            PayForDbbVC *payDbbVC = [[PayForDbbVC alloc]init];
            //            payDbbVC.peizhiDic = dic[@"data"];
            //            [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:payDbbVC animated:YES];
            NSInteger is_alipay_mobile = 1;
            NSInteger is_iapppay_wx = 1;
            NSInteger is_iapppay_zf = 1;
            NSInteger is_pingpp_jd = 1;
            NSDictionary *data = dic[@"data"];
            //判断支付宝是否可用
            id available = data[@"valid_pays"][@"alipay_mobile"][@"available"];
            if ( [available class] != [NSNull class]){
                is_alipay_mobile = [(NSNumber*)available integerValue];
            }else{
                is_alipay_mobile = 0;
            }
            
            //判断iapppay微信是否可用
            available =data[@"valid_pays"][@"iapppay"][@"available"];
            if ( [available class] != [NSNull class]){
                is_iapppay_wx = [(NSNumber*)available integerValue];
            }else{
                is_iapppay_wx = 0;
            }
            
            //判断iapppay支付宝是否可用
            available =data[@"valid_pays"][@"iapppay_alipay"][@"available"];
            if ( [available class] != [NSNull class]){
                is_iapppay_zf = [(NSNumber*)available integerValue];
            }else{
                is_iapppay_zf = 0;
            }
            
            //判断pingpp京东支付是否可用
            available =data[@"valid_pays"][@"pingpp"][@"available"];
            if ( [available class] != [NSNull class]){
                is_pingpp_jd = [(NSNumber*)available integerValue];
            }else{
                is_pingpp_jd = 0;
            }
            
            
            ChongZhiController *chongZhiVC = [[ChongZhiController alloc]init];
            chongZhiVC.peizhiDic = dic[@"data"];
            //将是否支付可用的传递给chongZhiVC
            chongZhiVC.is_alipay_mobile = is_alipay_mobile;
            chongZhiVC.is_iapppay_wx  = is_iapppay_wx;
            chongZhiVC.is_iapppay_zfb = is_iapppay_zf;
            chongZhiVC.is_pingpp_jd  = is_pingpp_jd;
            //将支付模型传入chongZhiVC
            [self setInitChongZhiInfoIntoChongZhiController:chongZhiVC dict:dic];
            //获取主tabar的navigationController push充值控制器
            [[WYMainTabBarVC shareMainTaBarVC].navigationController pushViewController:chongZhiVC animated:YES];
            
        }else{
            if(ret.intValue>2000 && ret.intValue < 3000){
                //用户过期，强制重新登录 先删除用户信息
                [UserInfo deleteUserInfo];
                //登录
                [WYPublic ifUserHaveLogin];
                [WYPublic showMessageWithTitle:@"提示：" Msg:@"登录信息已过期"];
            }
            
        }
        [WYPublic removeZheZhaoToWindow];
    } failedBlock:^{
        [WYPublic removeZheZhaoToWindow];
    } needLog:NO];
}

//将获取到的充值模型转导充值控制器中
//此处的dic是原生的dic 需要手动将其他的数据剥离s
- (void)setInitChongZhiInfoIntoChongZhiController:(ChongZhiController*)chongZhiVC dict:(NSDictionary*)dic{
    //支付宝支付模型
    PayInfoModel *zfbPayModel = [[PayInfoModel alloc]init];
    NSDictionary *dict1 = dic[@"data"][@"valid_pays"][@"alipay_mobile"][@"pay_info"];
    if (![dict1 isKindOfClass:[NSNull class]]){
        [zfbPayModel setValuesForKeysWithDictionary:dict1];
    }
    //爱贝微信支付模型
    PayInfoModel *iapppayWXPayModel = [[PayInfoModel alloc]init];
    NSDictionary *dict2 = dic[@"data"][@"valid_pays"][@"iapppay"][@"pay_info"];
    if (![dict2 isKindOfClass:[NSNull class]]){
        [iapppayWXPayModel setValuesForKeysWithDictionary:dict2];
    }
    //爱贝微信支付模型
    PayInfoModel *iapppayzfbPayModel = [[PayInfoModel alloc]init];
    NSDictionary *dict3 = dic[@"data"][@"valid_pays"][@"iapppay_alipay"][@"pay_info"];
    if (![dict3 isKindOfClass:[NSNull class]]){
        [iapppayzfbPayModel setValuesForKeysWithDictionary:dict3];
    }
    //pingpp京东支付模型
    PayInfoModel *pingppJDPayModel = [[PayInfoModel alloc]init];
    NSDictionary *dict4 = dic[@"data"][@"valid_pays"][@"pingpp"][@"pay_info"];
    if (![dict4 isKindOfClass:[NSNull class]]){
        [pingppJDPayModel setValuesForKeysWithDictionary:dict4];
    }
    
    chongZhiVC.zfbModel = zfbPayModel;
    chongZhiVC.iapppayWXModel = iapppayWXPayModel;
    chongZhiVC.iapppayzfbModel = iapppayzfbPayModel;
    chongZhiVC.pingppJDModel = pingppJDPayModel;
    
}

@end
